﻿using RabbitMQClient;
using System;

namespace RabbitMQWorkQueuesPublish
{
    class Program
    {
        static void Main(string[] args)
        {
            RabbitMQClient.IRabbitMQClient client = new RabbitMQClient.RabbitMQClient(
                host: "localhost",
                port: 5672,
                userName: "root",
                passowrd: "123456"
            );

            for (int i = 20; i < 40; i++)
            {
                Message message = new Message()
                {
                    a = i.ToString(),
                    b = "b" + i
                };
                Console.WriteLine(Newtonsoft.Json.JsonConvert.SerializeObject(message));
                client.Send<Message>(message, "queue_task");
            }
            Console.WriteLine("数据发送完成。");
            Console.ReadLine();
        }
    }
}
